//
//  HMVisitorTableViewController.m
//  微博app--OC
//
//  Created by xmy on 16/8/31.
//  Copyright © 2016年 xmy. All rights reserved.
//

#import "HMVisitorTableViewController.h"
#import "HMVisitorView.h"
#import "UIBarButtonItem+MYBarButtonItem.h"

@interface HMVisitorTableViewController ()

@end

@implementation HMVisitorTableViewController

-(void)loadView{
    
    if(self.userLogin){
        [super loadView];
    }else{
        //调用自己的view
        [self setupVisitView];
    }
    
}
//自定义view
- (void)setupVisitView{
    
    self.view = self.visitorView;
    
}
//
- (void)viewDidLoad {
    [super viewDidLoad];
    
    //设置左右登录按钮
    self.navigationItem.rightBarButtonItem = [UIBarButtonItem barWithImageName:nil title:@"注册" target:self action:@selector(register)];
    
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem barWithImageName:nil title:@"登录" target:self action:@selector(loginView)];
}
//注册按钮点击事件
- (void)register{
    NSLog(@"注册");
}
//登录按钮的点击事件
- (void)loginView{
    NSLog(@"登录");
}


//懒加载
-(HMVisitorView *)visitorView{
    if (_visitorView == nil){
        
       _visitorView = [[HMVisitorView alloc]init];
       
    }
    return _visitorView;
 
}
@end
